{% if not environment.web %}
{% extends 'index.html' %}
{% endif %}


{% block body %}
<div class="row">
     <div class="col-xs-12 col-md-12">
        <div class="panel panel-default">
  <div class="panel-heading"><h3>{{dao.registro_numerazione}} -{{dao.operazione}} - N° {{dao.numero}} / {{dao.parte|nonone}} del {{utils.dateTimeToString(dao.data_movimento)}}</h3></div>
  <div class="panel-body">
           {% if dao.id_cliente %}
<div class="col-sm-12"><span class="label label-default">Cliente</span><h4 style="display:inline;"> {{dao.ragione_sociale_cliente}}</h4>

</div>
      {% endif %}
      {% if dao.id_fornitore %}
      <div class="col-sm-6"><span class="label label-default">Fornitore</span><h4 style="display:inline;"> {{dao.ragione_sociale_fornitore}}</h4>
      </div>
      {% endif %}
                  <div class="clearfix"></div>
       <div class="col-sm-12"><span class="label label-default">Note</span><h4 style="display:inline;"> {{dao.note_interne}}</h4>
      </div>
       <div style="margin-bottom: 5px" class="clearfix"></div>

                <div class="panel panel-warning">
            <div class="panel-heading">
              <h3 class="panel-title">RIGHE&nbsp;&nbsp; ({{dao.righe|length}})</h3>
            </div>
            <div class="panel-body">
<div class="table-responsive">
  <table class="table  table-bordered table-striped table-condensed">

       <tr>
            <th>Magazzino</th>
            <th>Codice Art.</th>
            <th>Articolo</th>
            <th>Iva (%)</th>
            <th>Quantita'</th>
            <th>Prezzo netto</th>
            <th>Totale</th>
        </tr>
        {% for riga in dao.righe %}
        <tr >
            {% if riga.id_magazzino %}
            <td>{{riga.magazzino}}</td>
            {% else %}
            <td></td>
            {% endif %}
            <td>{{riga.codice_articolo}}</td>
            <td>{{riga.descrizione|nonone}}</td>
            <td>{{utils.number_format() % riga.percentuale_iva}}</td>
            <td>{{utils.number_format() % ( riga.quantita * riga.moltiplicatore)}}</td>
            <td>{{utils.number_format() % riga.valore_unitario_netto}}</td>
            <td><strong>{{utils.number_format() % ( riga.quantita * riga.moltiplicatore * riga.valore_unitario_netto )}}</strong></td>
        </tr>
        {% endfor %}
        </table>
    </div>
    </div>
{% endblock %}
